package com.zwy.Shopping.servlet_;

import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import java.io.IOException;
@WebServlet("/login-out")
public class LoginoutServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.getSession().setAttribute("user",null);
        ServletContext application = this.getServletContext();
        application.setAttribute("cartItemNum",null);
        request.setAttribute("message","您已退出登录");
        request.setAttribute("page","index.jsp");
        request.getRequestDispatcher("alert.jsp").forward(request,response);
    }
}
